Skip to content

feat(demo): seed from scriptor-cms.dev snapshot instead of programmatic#53

Merged
bigin merged 1 commit into
masterfrom
feat/demo-seed-from-scriptor-cms
May 15, 2026
Merged

feat(demo): seed from scriptor-cms.dev snapshot instead of programmatic#53
bigin merged 1 commit into
masterfrom
feat/demo-seed-from-scriptor-cms

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 15, 2026

The demo container used to invent a "Hello, world" page in code via docker/seed-demo.php. That diverged from the real Scriptor home site (https://scriptor-cms.dev / live mirror scriptor.cms) which has the canonical Scriptor demo content — themed pages, Articles with sample posts, Contact + Footer Pages hierarchy, real Unsplash imagery.

This makes the Docker demo show the SAME site as production:

docker/seed-demo.sql — sqlite3 dump captured via
vendor/bin/imanager dump
(full schema + data, 93 lines)
docker/seed-demo-uploads.tar.gz — public/uploads/ for the three
referenced image dirs (568 KB,
ustar format to keep alpine
busybox tar quiet)

The entrypoint now restores the snapshot on first start (no DB), then runs schema:migrate so a dump captured on an older schema is caught up if the image carries newer migrations. The programmatic seed-demo.php is gone.

Admin credentials in the seed match scriptor.cms: admin / gT5nLazzyBob — bcrypt-hashed.

Refreshing the seed when scriptor.cms content evolves:
vendor/bin/imanager dump --db=data/imanager.db > docker/seed-demo.sql
COPYFILE_DISABLE=1 tar --format=ustar -czf docker/seed-demo-uploads.tar.gz
-C public uploads/

Verified locally on macOS Docker 28.1:

  • up -d --build → seed restored, no tar warnings, all 8 pages routable (incl. nested /some-pages/legal-notice/), uploaded images served from /uploads/.
  • down (no -v) + up → entrypoint sees DB, skips seed, state preserved.

The demo container used to invent a "Hello, world" page in code via
docker/seed-demo.php. That diverged from the real Scriptor home site
(https://scriptor-cms.dev / live mirror scriptor.cms) which has the
canonical Scriptor demo content — themed pages, Articles with sample
posts, Contact + Footer Pages hierarchy, real Unsplash imagery.

This makes the Docker demo show the SAME site as production:

  docker/seed-demo.sql            — sqlite3 dump captured via
                                    `vendor/bin/imanager dump`
                                    (full schema + data, 93 lines)
  docker/seed-demo-uploads.tar.gz — public/uploads/ for the three
                                    referenced image dirs (568 KB,
                                    ustar format to keep alpine
                                    busybox tar quiet)

The entrypoint now restores the snapshot on first start (no DB),
then runs schema:migrate so a dump captured on an older schema is
caught up if the image carries newer migrations. The programmatic
seed-demo.php is gone.

Admin credentials in the seed match scriptor.cms: admin /
gT5nLazzyBob — bcrypt-hashed.

Refreshing the seed when scriptor.cms content evolves:
  vendor/bin/imanager dump --db=data/imanager.db > docker/seed-demo.sql
  COPYFILE_DISABLE=1 tar --format=ustar -czf docker/seed-demo-uploads.tar.gz \
    -C public uploads/<referenced-subdirs>

Verified locally on macOS Docker 28.1:
  - up -d --build → seed restored, no tar warnings, all 8 pages
    routable (incl. nested /some-pages/legal-notice/), uploaded
    images served from /uploads/.
  - down (no -v) + up → entrypoint sees DB, skips seed, state preserved.
@bigin bigin merged commit 9d9f862 into master May 15, 2026
@bigin bigin deleted the feat/demo-seed-from-scriptor-cms branch May 15, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant